function [res, u] = fn_f(n, k, a, vk, vFT, ck, cX)

Num = length(cX);
res = fn_int_an(n, vk, vFT, k);

for m = 1:Num
    
   res = res - fn_int_Tnm(n, m, ck{m}, cX{m}, k); 
    
end

u = res;
res = -log((1 + exp(-res)*a)/(1+a));

end